﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Core.Business;

namespace TicketManagement.Template
{
    public partial class uStaffMenu : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["User"] != null)
            {
                UserBus userBus = new UserBus();
                Core.Entity.User user = userBus.get((int)Session["User"]);

                String currentUrl = HttpContext.Current.Request.Url.AbsoluteUri;
                if (!currentUrl.Contains("Question"))
                {
                    if (user.UserTypeId == 4)
                    {
                        // Redirect to index page if the logged in user is an account
                        Response.Redirect("/Home/Index.aspx", true);
                    }
                }

                if (user.UserTypeId == 1 || user.UserTypeId == 2)
                {
                    allRequest.Visible = true;
                }
            }
        }
    }
}